package com.example.qimo.commom;

import lombok.Data;
import org.springframework.stereotype.Service;

@Service
@Data
public class Result<T> {

    private int status;
    private String msg;
    private Object data;

    public Result() {}
    public Result(int status, String msg) {
        this.status = status;
        this.msg = msg;

    }
    public Result(int status, String msg, Object data) {

        this.status = status;
        this.msg = msg;
        this.data = data;
    }

    public static Result success(Object data) {
        return new Result(200, "ok",data);
    }
    public static Result error(String msg) {
        return new Result(500,msg);
    }



    }


